#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include"sqlist.h"



	int main()
{
	int array[] = {1,3,5,6,7,8};
	int array1[] = {1,2,3,4,5,6,7};
	int i;
	sqlist *list = NULL;
	sqlist *list1 = NULL;

	sqlist_create(&list);
	if(list == NULL)
	{
		fprintf(stderr,"Error111111!");
		exit(1);
	}

	for(i = 0;i < sizeof(array)/sizeof(*array);i++)
	if((sqlist_insert(list,0,&array[i])) != 0)
	{
		fprintf(stderr,"Error!2222222");
		exit(1);
	}

	sqlist_create(&list1);
	if(list1 == NULL)
	{
		fprintf(stderr,"Error111111!");
		exit(1);
	}

	for(i = 0;i < sizeof(array1)/sizeof(*array1);i++)
	if((sqlist_insert(list1,0,&array1[i])) != 0)
	{
		fprintf(stderr,"Error!2222222");
		exit(1);
	}

	sqlist_display(list);
	sqlist_display(list1);

	sqlist_union(list,list1);
	sqlist_display(list);

	sqlist_delete(list,0);
	sqlist_display(list);
		
	
	sqlist_destroy(list);
	sqlist_destroy(list1);

	exit(0);
}
